AppCompatImageView

(SESL variant) A ImageView which supports compatible features on older versions of the platform, including:

  • Allows dynamic tint of its background via the background tint methods in androidx.core.view.ViewCompat.
  • Allows setting of the background tint using backgroundTint and backgroundTintMode.
  • Allows dynamic tint of its image via the image tint methods in ImageViewCompat.
  • Allows setting of the image tint using tint and tintMode.

This will automatically be used when you use ImageView in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.

Constructors

Link copied to clipboard
constructor(@NonNull context: @NonNull Context)
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet)
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int)

Functions

Link copied to clipboard
This should be accessed via getBackgroundTintList
Link copied to clipboard
This should be accessed via getBackgroundTintMode
Link copied to clipboard
This should be accessed via getImageTintList
Link copied to clipboard
This should be accessed via getImageTintMode
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setBackgroundDrawable(@Nullable background: @Nullable Drawable)
Link copied to clipboard
Link copied to clipboard
open fun setImageBitmap(bm: Bitmap)
Link copied to clipboard
open fun setImageDrawable(@Nullable drawable: @Nullable Drawable)
Link copied to clipboard
open fun setImageLevel(level: Int)
Link copied to clipboard
open fun setImageResource(@DrawableRes resId: Int)
Sets a drawable as the content of this ImageView.
Link copied to clipboard
open fun setImageURI(@Nullable uri: @Nullable Uri)
Link copied to clipboard
open fun setSupportBackgroundTintList(@Nullable tint: @Nullable ColorStateList)
This should be accessed via setBackgroundTintList
Link copied to clipboard
This should be accessed via setBackgroundTintMode
Link copied to clipboard
open fun setSupportImageTintList(@Nullable tint: @Nullable ColorStateList)
This should be accessed via setImageTintList
Link copied to clipboard
This should be accessed via setImageTintMode